const http = uni.$u.http;
import {
  baseUrlA,
  baseUrl,
  baseUrlOld2,
  xgbaseUrl,
  newamHistoryBaseUrl,
  aomendrawBaerUrl,
  hkBaseUrl,
  hkmoreBaseUrl,
  hkBaseUrl2,
} from "@/common/config.js";
// 新澳門六合彩直播源地址
// 線路一
// https://play666.macau-lhc.live/live/mosixmark.flv
// 線路二
// https://play888.00853lhc.live/live/mosixmark.flv
// 線路三
// https://live-macaujc.com/live/livestream/new.flv
// 澳門六合彩直播地址
// 線路一
// https://live-macaujc.com/live/livestream/macaujc2230.flv
// 登录
export const userLogin = (params, config = {}) =>
  http.post("/api/app/user/login/", params, {
    custom: {
      googleUnShow: true,
    },
  });
export const getlivelist = (params, config = {}) =>
  http.get("/history/macaujc2/y/2024", params, {
    custom: {
      googleUnShow: true,
    },
  });
export const getlivedata = (params, config = {}) =>
  http.get("/history/macaujc/y/2024", params, {});
export const getliveshow = (params, config = {}) =>
  http.get("/api/live2/", params, {
    custom: {
      googleUnShow: true,
    },
  });
export const getliveshowdata = (params, config = {}) =>
  http.get("/api/live/", params, {
    custom: {
      googleUnShow: true,
    },
  });
// 首页》》》》》》》》》》》》》》》》》
export const gethomeCodeApi = (params, config = {}) =>
  http.get(`/history/macaujc2/y/${new Date().getFullYear()}`, params, {});
export const gethomemacaujcCodeApi = (params, config = {}) =>
  http.get(`/history/macaujc/y/${new Date().getFullYear()}`, params, {});
export const gethomeMatheeCodeApi = (params, config = {}) =>
  http.post("/history/macaujc3", params, {});
export const gethomeliveApi = (url, params, config = {}) =>
  http.get(url, params, {});
// export const oldamhomeApi = (params, config = {}) => http.get(`${baseUrl}/api/CurrentInfo/2032`, params, {})
export const oldamhomeApi = (params, config = {}) =>
  http.get(`${xgbaseUrl}/api/open/marksix3?year=${params.year}`, params, {});
export const oldamcodehomeApi = (issue, params, config = {}) => {
  const url = `${baseUrl}/api/IssueOpenInfo/2032/${issue}`;
  return http.get(url, params, config);
};
// export const newamhomeApi = (params, config = {}) => http.get(`${baseUrlA}/api/CurrentInfo?lotteryId=2032`, params, {})
export const newamhomeApi = (params, config = {}) =>
  http.get(`${xgbaseUrl}/api/open/marksix2?year=${params.year}`, params, {});
// 新澳门六合彩历史开奖↓
// export const newamhomeApi = (params, config = {}) => http.get(
// 	`${newamHistoryBaseUrl}/history/macaujc2/y/${params.year}`, params, {})
// 老澳门六合彩历史开奖
// export const oldamhomeApi = (params, config = {}) => http.get(`${newamHistoryBaseUrl}/history/macaujc/y/${params.year}`,
// 	params, {})
export const xghomeApi = (params, config = {}) =>
  http.get(
    `${xgbaseUrl}/api/open/hk_six_history?year=${params.year}`,
    params,
    {}
  );
export const newamcodehomeApi = (urldata, params, config = {}) => {
  const url = `${baseUrlA}/api/IssueOpenInfo?issue=${urldata.issue}&lotteryId=2032`;
  return http.get(url, params, config);
};
// export const getXAMNewData = (params, config = {}) => http.get('/api/macaujc2.com', params, {})

// //新澳门六合彩 最新一期开奖接口
// export const getXAMNewData = (params, config = {}) => http.get('/api/macaujc2.com', params, {})
// //澳门六合彩 最新一期开奖接口
// export const getAMNewData = (params, config = {}) => http.get('/api/macaujc.com', params, {})
// //澳门六合彩3分钟 最新一期开奖接口
// export const get3NewData = (params, config = {}) => http.get('/api/macaujc3.com', params, {})

//新澳门六合彩 历史开奖接口
// export const getXAMHistory = (params, config = {}) => http.get(
// 	`${baseUrlA}/api/HistoryOpenInfo?issueNum=${new Date().getFullYear()}-${(new Date().getMonth() + 1).toString().padStart(2, '0')}-${new Date().getDate().toString().padStart(2, '0')}&lotteryId=2032`,
// 	params, {})

export const getXAMHistory = (params, config = {}) =>
  http.get(
    `${newamHistoryBaseUrl}/history/macaujc2/y/?issueNum=${new Date().getFullYear()}-${(
      new Date().getMonth() + 1
    )
      .toString()
      .padStart(2, "0")}-${new Date()
      .getDate()
      .toString()
      .padStart(2, "0")}&lotteryId=2032`,
    params,
    {}
  );

//澳门六合彩 历史开奖接口
export const getAMHistory = (params, config = {}) =>
  http.get(
    `${baseUrlOld2}/api/HistoryOpenInfo/2032/${new Date().getFullYear()}-${(
      new Date().getMonth() + 1
    )
      .toString()
      .padStart(2, "0")}-${new Date().getDate().toString().padStart(2, "0")}`,
    params,
    {}
  );
//新澳门六合彩3分钟 历史开奖接口
export const get3History = (params, config = {}) =>
  http.post("/history/macaujc3", params, {});

// 新澳门六合彩最新一期开奖new
export const getnewMacao = (params, config = {}) =>
  http.get(`${aomendrawBaerUrl}/api/macaujc2.com`, params, {});
// 澳门六合彩最新一期开奖new
export const getoldMacao = (params, config = {}) =>
  http.get(`${'https://api.bjjfnet.com/data/opencode/2032'}`, params, {});
// 香港彩最新一期开奖new
export const gethkLott = (params, config = {}) =>
  http.get(`${hkBaseUrl}`, params, {});
// 香港网开奖历史new
export const gethkLottrowmore = (params, config = {}) =>
  http.get(`${hkmoreBaseUrl}`, params, {});

// 下期香港彩接口
export const getupxgDetadeil = (params, config = {}) =>
  http.get(
    `${xgbaseUrl}/api/open/hk_six_issue`,
    params,
    {}
  );
export const gethkLott2 = (params, config = {}) =>
  http.get(`${hkBaseUrl2}`, params, {});

